home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Helpers / Tzu Release 4 / Tool Development / Writing Tzu Tools < prev   
Encoding:
Text File  |  1994-11-03  |  1000 b   |  29 lines  |  [TEXT/ALFA]

  1. Writing Tzu Tools
  2. Tzu/3 for CodeWarrior
  3. ©1994 Chris K. Thomas.  All Rights Reserved.
  4.  
  5. Tzu Tools are simple to write.  The enclosed sample projects make good 
  6. templates.
  7.  
  8. Your main() function should be declared thusly:
  9.  
  10. C/++:
  11. pascal void main(Handle theTextHandle);
  12.  
  13. Pascal:
  14. PROCEDURE main (theText: Handle);
  15.  
  16. ...  where theTextHandle is a locked handle to the currently selected 
  17. text.  It's yours to manipulate.  Just be sure to lock it before 
  18. returning if you unlock it.
  19.  
  20. The tool's resource file is guaranteed to be open, so go ahead and use 
  21. any resources as you might like.
  22.  
  23. Yes, this is too simplistic.  It doesn't provide for error checking, for 
  24. one thing.  It also doesn't provide any mechanisms for preferences.  
  25. These will be fixed in future releases.  (But simple mode will still be 
  26. supported - it's easier to write simple first, then add fancy stuff..)
  27.  
  28. The code resource type is 'Tool', the file type is 'Tool', the creator 
  29. is ' tZu' (space-t-Z-u), the code resource id is 0 (zero).